import { MatchStatus, SportsType, MatchType, BettingType } from '@/enums'

export type TrendType = 'up' | 'down' | ''

export interface Match {
	eventId: string
	sortId: number
	eventName: string
	sportId: SportsType
	sportName: string
	leagueId: string
	leagueName: string
	status: MatchStatus
	isDisabled: boolean
	isLive: boolean
	liveGameState: LiveGameState
	regionCode: string
	startEventDate: Date
	type: MatchType
	homeTeamId: string
	homeTeamName: string
	homeIcon: string
	awayTeamId: string
	awayTeamName: string
	awayIcon: string
	markets: Market[]
	scores: Scores
	marketsNumber: number
	betTimes: number
	channel: string
}

export interface LiveGameState {
	clockDirection: number
	clockRunning: boolean
	gamePart: number
	gameTime: number
	gameTimeBFFGotAt: number
}

export interface Market {
	marketId: string
	marketTypeId: string
	marketTypeCate: BettingType
	marketTypeDesc: string
	marketTypeName: string
	startDate: Date
	selections: Selection[]
	isDisabled: boolean
	level: number
	updateTimestamp: string
	isExactScore?: boolean
}

export interface Selection {
	id: string
	trueOdds: number
	displayOdds: string
	points?: number
	status: MatchStatus
	isDisabled: boolean
	side: number
	betslipLine: string
	trend: TrendType
}

export interface Scores {
	homeScore: string
	homeRedCards: string
	homeYellowCards: string
	homeCorners: string
	awayScore: string
	awayRedCards: string
	awayYellowCards: string
	awayCorners: string
}

export interface LeagueType {
	locale: string
	regionId: string
	regionCode: string
	isTopLeague: boolean
	masterLeagueId: string
	eventsCount: number
	location: number
	leagueId: string
	leagueName: string
	sportId: SportsType
	sportName: string
	shortName: string
	icon: string
	sort: number
	regionName: string
}

export interface RegionType {
	regionId: string
	regionCode: string
	regionName: string
	sportId: SportsType
	sportName: string
	icon: string
	leagues: LeagueType[]
	isSys: boolean
}

export interface MarketMainType {
	marketTypeId: string
	name: string
	sportId: string
	type: string
	marketTypeCate: string
}
